package com.example.myapplication9_2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button btn1 = findViewById(R.id.button);
        EditText name = findViewById(R.id.nameedt);
        EditText id = findViewById(R.id.idedt);
        EditText department = findViewById(R.id.departmentedt);
        EditText major = findViewById(R.id.majoredt);

        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this,SecondActivity.class);

                intent.putExtra("name",name.getText().toString());
                intent.putExtra("id",id.getText().toString());
                intent.putExtra("department",department.getText().toString());
                intent.putExtra("major",major.getText().toString());

                startActivity(intent);
            }
        });
    }
}